package operation;

import book.BookList;

public class ExitOperation implements IOperation{

    @Override
    public void work(BookList bookList) {
        System.out.println("退出系统");

        int currentSize = bookList.getUsedSize();

        //将所有书的数据全部请空
        for (int i = 0; i < currentSize; i++) {
            bookList.setBooks(i,null);
        }
        //书的数量为0
        bookList.setUsedSize(0);

        System.exit(0);
    }
}
